home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / man / cat3 / XmClipboardStartCopy.z / XmClipboardStartCopy
Encoding:
Text File  |  2003-11-18  |  10.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXmmmmCCCClllliiiippppbbbbooooaaaarrrrddddSSSSttttaaaarrrrttttCCCCooooppppyyyy((((3333XXXX))))  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV  XXXXmmmmCCCClllliiiippppbbbbooooaaaarrrrddddSSSSttttaaaarrrrttttCCCCooooppppyyyy((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       _X_m_C_l_i_p_b_o_a_r_d_S_t_a_r_t_C_o_p_y - A clipboard function that sets    up a
  10.       storage and data structure
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.       #include <Xm/Xm.h>
  14.       #include <Xm/CutPaste.h>
  15.  
  16.       int _X_m_C_l_i_p_b_o_a_r_d_S_t_a_r_t_C_o_p_y (ddddiiiissssppppllllaaaayyyy,,,, wwwwiiiinnnnddddoooowwww,,,, cccclllliiiipppp____llllaaaabbbbeeeellll,,,,
  17.             ttttiiiimmmmeeeessssttttaaaammmmpppp,,,, wwwwiiiiddddggggeeeetttt,,,, ccccaaaallllllllbbbbaaaacccckkkk,,,, iiiitttteeeemmmm____iiiidddd)
  18.            _D_i_s_p_l_a_y     **** ddddiiiissssppppllllaaaayyyy;
  19.            _W_i_n_d_o_w     wwwwiiiinnnnddddoooowwww;
  20.            _X_m_S_t_r_i_n_g     cccclllliiiipppp____llllaaaabbbbeeeellll;
  21.            _T_i_m_e     ttttiiiimmmmeeeessssttttaaaammmmpppp;
  22.            _W_i_d_g_e_t     wwwwiiiiddddggggeeeetttt;
  23.            _X_m_C_u_t_P_a_s_t_e_P_r_o_cccccaaaallllllllbbbbaaaacccckkkk;
  24.            _l_o_n_g     **** iiiitttteeeemmmm____iiiidddd;
  25.  
  26.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.       _X_m_C_l_i_p_b_o_a_r_d_S_t_a_r_t_C_o_p_y sets up storage and data    structures to
  28.       receive clipboard data.  An application calls    this function
  29.       during a cut or copy operation.  The data item that these
  30.       structures receive then becomes the next data    item in    the
  31.       clipboard.
  32.  
  33.       Copying a large piece    of data    to the clipboard can take a
  34.       long time.  It is possible that, once    copied,    no application
  35.       will ever request that data.    The Motif Toolkit provides a
  36.       mechanism so that an application does    not need to actually
  37.       pass data to the clipboard until the data has    been requested
  38.       by some application.
  39.  
  40.       Instead, the application passes format and length
  41.       information in _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y to the    clipboard functions,
  42.       along    with a widget ID and a callback    function address that
  43.       is passed in _X_m_C_l_i_p_b_o_a_r_d_S_t_a_r_t_C_o_p_y.  The widget ID is needed
  44.       for communications between the clipboard functions in    the
  45.       application that owns    the data and the clipboard functions
  46.       in the application that requests the data.
  47.  
  48.       The callback functions are responsible for copying the
  49.       actual data to the clipboard via _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y_B_y_N_a_m_e.  The
  50.       callback function is also called if the data item is removed
  51.       from the clipboard, and the actual data is therefore no
  52.       longer needed.
  53.  
  54.       ddddiiiissssppppllllaaaayyyy
  55.            Specifies a pointer to the _D_i_s_p_l_a_y structure that was
  56.            returned    in a previous call to _X_O_p_e_n_D_i_s_p_l_a_y or
  57.            _X_t_D_i_s_p_l_a_y.
  58.  
  59.       wwwwiiiinnnnddddoooowwww
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 11/11/03)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXmmmmCCCClllliiiippppbbbbooooaaaarrrrddddSSSSttttaaaarrrrttttCCCCooooppppyyyy((((3333XXXX))))  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV  XXXXmmmmCCCClllliiiippppbbbbooooaaaarrrrddddSSSSttttaaaarrrrttttCCCCooooppppyyyy((((3333XXXX))))
  71.  
  72.  
  73.  
  74.            Specifies a widget's window ID that relates the
  75.            application window to the clipboard.  The widget's
  76.            window ID can be    obtained by using _X_t_W_i_n_d_o_w.  The same
  77.            application instance should pass    the same window    ID to
  78.            each of the clipboard functions that it calls.
  79.  
  80.       cccclllliiiipppp____llllaaaabbbbeeeellll
  81.            Specifies the label to be associated with the data
  82.            item.  This argument is used to identify    the data item,
  83.            for example, in a clipboard viewer.  An example of a
  84.            label is    the name of the    application that places    the
  85.            data in the clipboard.
  86.  
  87.       ttttiiiimmmmeeeessssttttaaaammmmpppp
  88.            Specifies the time of the event that triggered the
  89.            copy.  A    valid timestamp    must be    supplied; it is    not
  90.            sufficient to use _C_u_r_r_e_n_t_T_i_m_e.
  91.  
  92.       wwwwiiiiddddggggeeeetttt
  93.            Specifies the ID    of the widget that receives messages
  94.            requesting data previously passed by name.  This
  95.            argument    must be    present    in order to pass data by name.
  96.            Any valid widget    ID in your application can be used for
  97.            this purpose and    all the    message    handling is taken care
  98.            of by the cut and paste functions.
  99.  
  100.       ccccaaaallllllllbbbbaaaacccckkkk
  101.            Specifies the address of    the callback function that is
  102.            called when the clipboard needs data that was
  103.            originally passed by name.  This    is also    the callback
  104.            to receive the _d_e_l_e_t_e message for items that were
  105.            originally passed by name.  This    argument must be
  106.            present in order    to pass    data by    name.
  107.  
  108.       iiiitttteeeemmmm____iiiidddd
  109.            Specifies the number assigned to    this data item.     The
  110.            application uses    this number in calls to
  111.            _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y,    _X_m_C_l_i_p_b_o_a_r_d_E_n_d_C_o_p_y, and
  112.            _X_m_C_l_i_p_b_o_a_r_d_C_a_n_c_e_l_C_o_p_y.
  113.  
  114.       For more information on passing data by name,    see
  115.       _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y(_3_X) and _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y_B_y_N_a_m_e(_3_X).
  116.  
  117.       The wwwwiiiiddddggggeeeetttt and ccccaaaallllllllbbbbaaaacccckkkk arguments must be present in order
  118.       to pass data by name.    The callback format is as follows:
  119.       void (*ccccaaaallllllllbbbbaaaacccckkkk)))) (wwwwiiiiddddggggeeeetttt,,,, ddddaaaattttaaaa____iiiidddd,,,, pppprrrriiiivvvvaaaatttteeee,,,, rrrreeeeaaaassssoooonnnn)
  120.         _W_i_d_g_e_t    wwwwiiiiddddggggeeeetttt;
  121.         _i_n_t          *ddddaaaattttaaaa____iiiidddd;
  122.         _i_n_t          *pppprrrriiiivvvvaaaatttteeee;
  123.         _i_n_t          *rrrreeeeaaaassssoooonnnn;
  124.  
  125.       wwwwiiiiddddggggeeeetttt
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 11/11/03)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXmmmmCCCClllliiiippppbbbbooooaaaarrrrddddSSSSttttaaaarrrrttttCCCCooooppppyyyy((((3333XXXX))))  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV  XXXXmmmmCCCClllliiiippppbbbbooooaaaarrrrddddSSSSttttaaaarrrrttttCCCCooooppppyyyy((((3333XXXX))))
  137.  
  138.  
  139.  
  140.            Specifies the ID    of the widget passed to    this function.
  141.  
  142.       ddddaaaattttaaaa____iiiidddd
  143.            Specifies the identifying number    returned by
  144.            _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y,    which identifies the pass-by-name
  145.            data.
  146.  
  147.       pppprrrriiiivvvvaaaatttteeee
  148.            Specifies the private information passed    to
  149.            _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y.
  150.  
  151.       rrrreeeeaaaassssoooonnnn
  152.            Specifies the reason, which is either
  153.            _X_m_C_R__C_L_I_P_B_O_A_R_D__D_A_T_A__D_E_L_E_T_E or
  154.            _X_m_C_R__C_L_I_P_B_O_A_R_D__D_A_T_A__R_E_Q_U_E_S_T.
  155.  
  156.      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  157.       _C_l_i_p_b_o_a_r_d_S_u_c_c_e_s_s
  158.            The function is successful.
  159.  
  160.       _C_l_i_p_b_o_a_r_d_L_o_c_k_e_d
  161.            The function failed because the clipboard was locked by
  162.            another application.  The application can continue to
  163.            call the    function again with the    same parameters    until
  164.            the lock    goes away.  This gives the application the
  165.            opportunity to ask if the user wants to keep trying or
  166.            to give up on the operation.
  167.  
  168.      RRRREEEELLLLAAAATTTTEEEEDDDD IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN
  169.       _X_m_C_l_i_p_b_o_a_r_d_C_a_n_c_e_l_C_o_p_y(_3_X), _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y(_3_X),
  170.       _X_m_C_l_i_p_b_o_a_r_d_C_o_p_y_B_y_N_a_m_e(_3_X), _X_m_C_l_i_p_b_o_a_r_d_E_n_d_C_o_p_y(_3_X),
  171.       _X_m_C_l_i_p_b_o_a_r_d_E_n_d_R_e_t_r_i_e_v_e(_3_X), _X_m_C_l_i_p_b_o_a_r_d_I_n_q_u_i_r_e_C_o_u_n_t(_3_X),
  172.       _X_m_C_l_i_p_b_o_a_r_d_I_n_q_u_i_r_e_F_o_r_m_a_t(_3_X),    _X_m_C_l_i_p_b_o_a_r_d_I_n_q_u_i_r_e_L_e_n_g_t_h(_3_X),
  173.       _X_m_C_l_i_p_b_o_a_r_d_I_n_q_u_i_r_e_P_e_n_d_i_n_g_I_t_e_m_s(_3_X), _X_m_C_l_i_p_b_o_a_r_d_L_o_c_k(_3_X),
  174.       _X_m_C_l_i_p_b_o_a_r_d_R_e_g_i_s_t_e_r_F_o_r_m_a_t(_3_X), _X_m_C_l_i_p_b_o_a_r_d_R_e_t_r_i_e_v_e(_3_X),
  175.       _X_m_C_l_i_p_b_o_a_r_d_S_t_a_r_t_R_e_t_r_i_e_v_e(_3_X),    _X_m_C_l_i_p_b_o_a_r_d_U_n_d_o_C_o_p_y(_3_X),
  176.       _X_m_C_l_i_p_b_o_a_r_d_U_n_l_o_c_k(_3_X), and _X_m_C_l_i_p_b_o_a_r_d_W_i_t_h_d_r_a_w_F_o_r_m_a_t(_3_X).
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                        (printed 11/11/03)
  196.  
  197.  
  198.  
  199.